#include <iostream>

using namespace std;

void process(int n, int q, int cases);

int search(int query, int *marbles, int n);

int binarySearch(int query, int *marbles, int i, int j);

void sort(int *array, int n);

void quickSort(int *array, int i, int j);

void swap(int *array, int i, int r);

int main() {


	int cases = 1;
	int N;
	int Q;
	while (true) {
		cin >> N;
		cin >> Q;
		if (N == 0 && Q == 0) {
			break;
		}
		process(N, Q, cases);
		cases++;
	}

}
	void process(int n, int q, int cases) {
		cout << "CASE# " << cases << ":" << endl;
		int marbles[n];
		for (int k = 0; k < n; k++) {
			cin >> marbles[k];
		}
		sort(marbles, n);
		for (int k = 0; k < q; k++) {
			
			int query;
			cin >> query;
			cout << query << " ";
			int place = search(query, marbles, n);
			
			if (place == -1) {
				cout << "not found" << endl;
			} else {
				for (int j = place; j >= 0; j--) {
					if (marbles[j] != query) {
						j++;
						cout << "found at " << (j+1) << endl;
						break;
					}
					if (j == 0) {
						cout << "found at " << (j+1) << endl;
						break;
					}
				}
			}
			
		}
		
		
	}

	 int search(int query, int *marbles, int n) {
		 return binarySearch(query, marbles, 0, n-1);
	}

	int binarySearch(int query, int *marbles, int i, int j) {
		if (i > j) {
			return -1;
		}
		int medium = (i + j) / 2;
		if (marbles[medium] == query) {
			return medium;
		} 
		
		if (query < marbles[medium]) {
			return binarySearch(query, marbles, i, medium - 1);
		} else {
			return binarySearch(query, marbles, medium+1, j);
		}
		
		
	}

	void sort(int *array, int n) {
	       quickSort(array, 0, n - 1);
	   }


	void quickSort(int *a, int lo0, int hi0) {
		int lo = lo0;
		int hi = hi0;
		int mid;

		if (hi0 > lo0) {

			mid = a[(lo0 + hi0) / 2];

			while (lo <= hi) {
				while ((lo < hi0) && (a[lo] < mid))
					++lo;

				while ((hi > lo0) && (a[hi] > mid))
					--hi;

				if (lo <= hi) {
					swap(a, lo, hi);

					++lo;
					--hi;
				}
			}

			if (lo0 < hi)
				quickSort(a, lo0, hi);

			if (lo < hi0)
				quickSort(a, lo, hi0);

		}
	}


	int partition(int *array, int p, int r) {
	       int x = array[r];
	       int i = p - 1;
	       for (int j = p; j < r; j++) {
	           if (array[j] <= x) {
	               i = i + 1;
	               swap(array, i, j);
	           }
	       }
	       swap(array, i + 1, r);
	       return i + 1;
	   }

	   void swap(int *array, int i, int r) {
	       int aux = array[i];
	       array[i] = array[r];
	       array[r] = aux;
	   }
